﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using QLBH.DataModel;

namespace QLBH.Model.Controller
{
   public class QLPhieuMuaHangChiTietController : QLBHEntityBase<PHIEUMUAHANGCT>
    {
       public static QLBHEntityBase<PHIEUMUAHANGCT> GetInstance()
       {
           return new QLPhieuMuaHangChiTietController();
       }
        public override PHIEUMUAHANGCT Add(PHIEUMUAHANGCT entity)
        {
            if (FindBy(it => it.MUAHANGID == entity.MUAHANGID && it.MHID == entity.MHID).FirstOrDefault() != null)
           {
               throw new Exception("Mặt Hàng  Đã Tồn tại");
           }
            
           
            return base.Add(entity);
        }
        public override PHIEUMUAHANGCT Edit(PHIEUMUAHANGCT entity)
        {
            return base.Edit(entity);
        }
    }
}
